
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module simpleparse.xml.xml_parser</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="simpleparse.html"><font color="#ffffff">simpleparse</font></a>.<a href="simpleparse.xml.html"><font color="#ffffff">xml</font></a>.xml_parser</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/mcfletch/pylive/simpleparse/xml/xml_parser.py">/home/mcfletch/pylive/simpleparse/xml/xml_parser.py</a></font></td></tr></table>
    <p><tt>XML&nbsp;Parser&nbsp;based&nbsp;(loosely)&nbsp;on&nbsp;the&nbsp;XML&nbsp;Spec's&nbsp;EBNF<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;hand-coded&nbsp;parser&nbsp;based&nbsp;on&nbsp;the&nbsp;W3C's&nbsp;XML&nbsp;specification,<br>
there&nbsp;was&nbsp;a&nbsp;lot&nbsp;of&nbsp;busy-work&nbsp;rewriting&nbsp;to&nbsp;make&nbsp;the&nbsp;syntax&nbsp;agree,<br>
but&nbsp;also&nbsp;a&nbsp;number&nbsp;of&nbsp;signficant&nbsp;structural&nbsp;changes&nbsp;required&nbsp;by<br>
the&nbsp;limitations&nbsp;of&nbsp;the&nbsp;SimpleParse&nbsp;engine,&nbsp;and&nbsp;the&nbsp;completely<br>
procedural&nbsp;definition&nbsp;of&nbsp;References&nbsp;in&nbsp;the&nbsp;XML&nbsp;spec&nbsp;(the&nbsp;References<br>
don't&nbsp;occur&nbsp;in&nbsp;most&nbsp;places&nbsp;they&nbsp;can&nbsp;occur,&nbsp;and&nbsp;they&nbsp;are&nbsp;seen&nbsp;as<br>
altering&nbsp;the&nbsp;buffer&nbsp;directly&nbsp;as&nbsp;soon&nbsp;as&nbsp;they&nbsp;are&nbsp;encountered,&nbsp;this<br>
isn't&nbsp;something&nbsp;that&nbsp;fits&nbsp;readily&nbsp;into&nbsp;the&nbsp;mx.TextTools&nbsp;engine.<br>
&nbsp;<br>
<a href="http://www.w3.org/TR/REC-xml#sec-references">http://www.w3.org/TR/REC-xml#sec-references</a><br>
&nbsp;<br>
Major&nbsp;Deviations&nbsp;from&nbsp;Spec:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;support&nbsp;for&nbsp;the&nbsp;unicode-style&nbsp;character&nbsp;classes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;support&nbsp;for&nbsp;UTF-16&nbsp;(or&nbsp;Unicode&nbsp;at&nbsp;all,&nbsp;for&nbsp;that&nbsp;matter)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;support&nbsp;for&nbsp;References&nbsp;that&nbsp;alter&nbsp;the&nbsp;production<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;being&nbsp;parsed,&nbsp;so&nbsp;you&nbsp;can't&nbsp;have&nbsp;a&nbsp;Reference&nbsp;to&nbsp;an<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item&nbsp;"&lt;/this&gt;and&lt;this&gt;"&nbsp;or&nbsp;similar&nbsp;non-structure-<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;respecting&nbsp;References.&nbsp;&nbsp;References&nbsp;have<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;particular&nbsp;locations&nbsp;they&nbsp;can&nbsp;occur,&nbsp;and&nbsp;they&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;just&nbsp;ignored&nbsp;elsewhere<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;support&nbsp;for&nbsp;parsing&nbsp;the&nbsp;contents&nbsp;of&nbsp;References&nbsp;within<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;primary&nbsp;parsing&nbsp;pass<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;support&nbsp;for&nbsp;excluded&nbsp;start/end&nbsp;tags<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comments&nbsp;allowed&nbsp;in&nbsp;both&nbsp;tags&nbsp;and&nbsp;declarations&nbsp;(but&nbsp;not<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inside&nbsp;content-specifiers).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allows&nbsp;end&nbsp;tags&nbsp;of&nbsp;the&nbsp;form&nbsp;&lt;/&gt;</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="simpleparse.common.chartypes.html">simpleparse.common.chartypes</a><br>
</td><td width="25%" valign=top><a href="simpleparse.common.numbers.html">simpleparse.common.numbers</a><br>
</td><td width="25%" valign=top><a href="simpleparse.common.strings.html">simpleparse.common.strings</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>declaration</strong> = "<font color="#c040c0">\n\n</font># Simple (changable) literals<font color="#c040c0">\n</font># These should b...&gt;'<font color="#c040c0">\n\n\n</font>document       :=    prolog, element, Misc*<font color="#c040c0">\n</font>"</td></tr></table>
</body></html>